Skip to content

Conversation

@tyranron
Copy link
Member

@tyranron tyranron commented May 7, 2020

Fixes #426
Extends #442

This PR is majorly based on @sd2k's work in #442 and adds support of Content-Type: application/graphql POST requests to all integration crates.

Also, some refactorings are made across codebase for better readability, and removing redudant boxing here and there.

juniper

  • Refactor HTTPIntegration to support application/graphql requests:
    • rename HTTPIntegration as HttpIntegration;
    • rename post as post_json method;
    • add post_graphql method.
  • Add test_graphql_post and test_invalid_graphql_post.
  • Update CHANGELOG/docs/examples.

juniper_actix

  • Update tests to support new HttpIntegration.
  • Fix application/graphql POST request support:
    • At the moment it deserializes request's body as JSON, which is not correct.
  • Update CHANGELOG/docs/examples. (initial release, so not CHANGELOG yet)

juniper_hyper

  • Update tests to support new HttpIntegration.
  • Run tests for both sync and async versions.
  • Support application/graphql POST request:
    • Return 400 Bad Request if Content-Type is absent or invalid.
  • Make async handler a default one (rename graphql_async -> graphql and graphql -> graphql_sync).
  • Update CHANGELOG/docs/examples.

juniper_iron

  • Update tests to support new HttpIntegration.
  • Support application/graphql POST request:
    • Return 400 Bad Request if Content-Type is absent or invalid.
  • Update CHANGELOG/docs/examples.

juniper_rocket

  • Update tests to support new HttpIntegration.
  • Support application/graphql POST request:
    • Forward request if Content-Type is absent or invalid.
  • Update CHANGELOG/docs/examples.

juniper_rocket_async

  • Update tests to support new HttpIntegration.
  • Support application/graphql POST request:
    • Forward request if Content-Type is absent or invalid.
  • Update CHANGELOG/docs/examples.

juniper_warp

  • Revive HttpIntegration tests (were commented).
  • Run tests for both sync and async versions.
  • Support application/graphql POST request:
    • Omit executing request if Content-Type is absent or invalid.
  • Update CHANGELOG/docs/examples.

@tyranron tyranron changed the title WIP: Support "Content-Type: application/graphql" (#426) Support "Content-Type: application/graphql" (#426) May 8, 2020
@tyranron tyranron marked this pull request as ready for review May 8, 2020 13:23
@tyranron
Copy link
Member Author

tyranron commented May 8, 2020

ping @LegNeato

@LegNeato LegNeato merged commit aedb2d1 into graphql-rust:master May 8, 2020
@LegNeato
Copy link
Member

LegNeato commented May 8, 2020

Yay, thanks!

@sd2k
Copy link

sd2k commented May 8, 2020

Awesome job @tyranron, thanks for taking this the rest of the way 😀

@tyranron tyranron deleted the support-graphql-content-type branch May 8, 2020 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support Content-Type: application/graphql

3 participants